package com.xty.itgroup.tech05tytex.Mapper.Impl;

import com.xty.itgroup.tech05tytex.Databean.Bean03Contract;
import com.xty.itgroup.tech05tytex.Databean.Bean03ContractDetail;
import com.xty.itgroup.tech05tytex.Mapper.Mapper03Contract;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class Impl03Contract implements Mapper03Contract {
    @Autowired
    private Mapper03Contract contract;

    @Override
    public void addContractMain(Bean03Contract bc) {
        contract.addContractMain(bc);
    }

    @Override
    public void addContractDetails(List<Bean03ContractDetail> details, int main_id) {
        contract.addContractDetails(details, main_id);
    }

    @Override
    public void lockContract(int tex_id) {
        contract.lockContract(tex_id);
    }

    @Override
    public Bean03Contract getContractMain(int tex_id) {
        return contract.getContractMain(tex_id);
    }

    @Override
    public List<Bean03ContractDetail> listContractDetail(int main_id) {
        return contract.listContractDetail(main_id);
    }

    @Override
    public List<Map<String, Object>> listContractMain(String user_name, String customer_name, String start_time, String end_time, int is_back, int status) {
        return contract.listContractMain(user_name==null?"%%":"%"+user_name+"%", customer_name==null?"%%":"%"+customer_name+"%", "".equals(start_time) || start_time == null ? null : start_time, "".equals(end_time) || end_time == null ? null : end_time, is_back, status);
    }

    @Override
    public void updateContrat(Bean03Contract bc) {
        contract.updateContrat(bc);
    }

    @Override
    public void deleteDetailByMain(int main_id) {
        contract.deleteDetailByMain(main_id);
    }

    @Override
    public void statusSet(int tex_id, int is_lock) {
        contract.statusSet(tex_id, is_lock);
    }

    @Override
    public void backDateSet(int tex_id, int is_back, String contract_back_date) {
        contract.backDateSet(tex_id, is_back, contract_back_date);
    }
}
